<div ng-init="initSystemStatus()">

    <div class="" id="nginxPath">
        <div class="row nginx-path-line">
            <div class="col-md-6" style="height: 25px">
                <input type="file" name="path" value="" file-upload-now="" file-name="nginx.executeFile">
            </div>
        </div>
        <div class="row nginx-path-line">
            <div class="col-md-6" style="height: 25px">
                <input type="text" name="path" value="" ng-model="nginx.installPath" ng-disabled="!installPathEditable">
            </div>
            <div class="col-md-4" style="height: 25px;padding-top: 2px">
                <input type="checkbox" ng-model="installPathEditable">
            </div>
        </div>
        <div class="row nginx-path-line">
            <div class="col-md-6" style="height: 25px">
                <input type="text" name="path" value="" ng-model="nginx.confPath" ng-disabled="!confPathEditable">
            </div>
            <div class="col-md-4" style="height: 25px;padding-top: 2px">
                <input type="checkbox" ng-model="confPathEditable">
            </div>
        </div>
        <div class="row nginx-path-line">
            <div class="col-md-1 text-left">
                <button ng-click="applyNgPath()">Apply</button>
            </div>
            <div class="col-md-1 text-left">
                <button ng-click="saveNgPath()">Save</button>
            </div>
        </div>
    </div>

    <div class="" id="nginxConfig">
        <div style="margin: 10px 0" ng-if="system.processes.count == 0">Stopped</div>
        <div style="margin: 10px 0" ng-if="system.processes.count > 0">Running</div>
        <div class="row nginx-path-line">
            <div class="col-md-2 text-left">
                <button class="md-button" ng-click="startNginx()" ng-disabled="system.processes.count > 0">Start Nginx</button>
            </div>
            <div class="col-md-2 text-left">
                <button class="md-button" ng-click="stopNginx()" ng-disabled="system.processes.count == 0">Stop Nginx</button>
            </div>
            <div class="col-md-2 text-left">
                <button class="md-button" ng-click="reloadNginx()" ng-disabled="system.processes.count == 0">Reload Nginx</button>
            </div>
            <div class="col-md-2 text-left">
                <button class="md-button" ng-click="killAll()" ng-disabled="system.processes.count == 0">Kill All</button>
            </div>
        </div>
        <div class="row nginx-path-line" ng-repeat="process in system.processes.processes">
            <div class="col-md-6 text-left">
                <span>{{process.name}}</span>
                &nbsp;
                <span>{{process.id}}</span>
            </div>
            <div class="col-md-2 text-left">
                <button class="md-button" ng-click="killThis(process.id)" ng-disabled="system.processes.count == 0">Kill This</button>
            </div>
        </div>
        <div>
            <pre ng-bind-html="system.conf"></pre>
            <textarea name="" id="" cols="30" rows="10" style="width: 100%;margin-bottom: 20px">
                {{system.conf}}
            </textarea>
        </div>
    </div>

</div>
